//
//  THJTransportView.m
//  THJXHW
//
//  Created by 河南德艺 on 2018/8/15.
//  Copyright © 2018年 河南德艺. All rights reserved.
//

#import "THJTransportView.h"

@implementation THJTransportView

- (IBAction)btn1Action:(UIButton*)sender {
    [self setBtnStyleWithBtn:sender];
    [self.delegate transportStyleSelect:sender.titleLabel.text];
}
- (IBAction)btn2Action:(UIButton*)sender {
    [self setBtnStyleWithBtn:sender];
    [self.delegate transportStyleSelect:sender.titleLabel.text];
}
- (IBAction)closeBtnAction:(id)sender {
    [self removeFromSuperview];
}

+(THJTransportView*)instancView{
    NSArray* nibView =  [[NSBundle mainBundle] loadNibNamed:@"THJTransportView" owner:nil options:nil];
    return [nibView objectAtIndex:0];
}
-(void)setBtnStyleWithBtn:(UIButton*)button{
    NSArray * btnArr = @[self.btn1,self.btn2];
    for (UIButton * btn in btnArr) {
        btn.backgroundColor = COLOR(242, 242, 242, 1);
        [btn setTitleColor:COLOR(35, 35, 35, 1) forState:UIControlStateNormal];
        btn.layer.borderWidth = 0;
    }
    [button setTitleColor:COLOR(250, 57, 9, 1) forState:UIControlStateNormal];
    button.layer.borderWidth = 1;
    button.layer.borderColor = COLOR(250, 57, 9, 1).CGColor;
}

@end
